package com.hhxy.string;

public class Test {
    public static void main(String[] args) {
        String s1 = "abc";
        String s2 = "ab";
        String s3 = s2 + "c";
        System.out.println(s1 == s3);//输出：false。？
        String s4 = "c";
        String s6 = s2 + s4;
        System.out.println(s1 == s6);//输出：false。
        String s7 = "a" + "b" +"c";
        System.out.println(s1 == s7);//输出：true。Java存在编译优化机制
    }
}
